<?php

namespace App\Listeners;

use App\Biz\VisitorApprovalLogBiz;
use App\Events\VisitorApprovalEvent;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Http;

class VisitorApprovalListener
{

    protected VisitorApprovalLogBiz $visitorApprovalLogBiz;

    /**
     * @param VisitorApprovalLogBiz $visitorApprovalLogBiz
     */
    public function __construct(VisitorApprovalLogBiz $visitorApprovalLogBiz)
    {
        $this->visitorApprovalLogBiz = $visitorApprovalLogBiz;
    }

    /**
     * Handle the event.
     *
     * @param \App\Events\VisitorApprovalEvent $event
     * @return void
     */
    public function handle(VisitorApprovalEvent $event)
    {
        $this->visitorApprovalLogBiz->createAndPutFile($event->visitorReservesList);
    }
}
